package run;

import mythread.MyThread;

/**
 * 方法isAlive()的功能是判断当前的线程是否处于活动状态
 */
public class Run {
	public static void main(String[] args) throws InterruptedException {
		MyThread mythread = new MyThread();
		System.out.println("begin ==" + mythread.isAlive());
		mythread.start();
		/**
		 * 输出值为true是因为mythread线程还未结束
		 * 如果加上如下代码：
		 * Thread.sleep(1000)
		 * 则会返回false
		 */

		System.out.println("end ==" + mythread.isAlive());
	}
}
